<script setup>
import { ref } from 'vue'
import { onLoad, onShareAppMessage } from '@dcloudio/uni-app'
import request from '@/utils/request'
import API from '@/utils/API'

// 分类图片
const classifyWall = ref([])

const getClassifyWall = async () => {
	const { data } = await request({
		url: API.getClassifyWall,
		data: {
			pageNum: 1,
			pageSize: 18
		}
	})
	
	// console.log(data)
	classifyWall.value = data
}

// 分享给好友
onShareAppMessage((e) => {
	return {
		title: '咸虾米壁纸',
		path: '/pages/classify/classify'
	}
})

onLoad(() => {
	getClassifyWall()
})
</script>

<template>
	<view class="classify pageBg">
		<custom-navbar title="分类" />
		<view class="content">
			<theme-item showType="classify" v-for="item in classifyWall" :key="item._id" :item="item" />
		</view>
	</view>
</template>

<style scoped lang="scss">
.classify {
	padding-top: 10rpx;
	
	.content {
		display: grid;
		grid-template-columns: repeat(3, 1fr);
		gap: 20rpx;
		padding: 0 25rpx;
	}
}
</style>
